/*
策略模式：先写个公共方法抽象类，再写多个抽象类的实现类，最终策略类中包含抽象类的对象，用以动态调用相应方法。
*/

//公共方法抽象类
class Interface{
public:
    virtual void handleFunc() = 0;
    virtual ~Interface() {}
};

class ProcessA : public Interface{
public:
    void handleFunc(){
        printf("Handle process A. \n");
    }
};

class ProcessB : public Interface{
public:
    void handleFunc(){
        printf("Handle process B. \n");
    }
};

class ProcessC : public Interface{
public:
    void handleFunc(){
        printf("Handle process C. \n");
    }
};

class Stragey_Context{
private:
    Interface* pInterface;
public:
    Stragey_Context(Interface* p) : pInterface(p) {}

    void toHandleProcess(){
        pInterface->handleFunc();
    }
};